#ifndef READER_H

#define READER_H

#include "WProgram.h"
#include "Func_def.h"
#include "float.h"
#include "pulsingEngine.h"

#define codeMax 150
#define CANON_LIM 36
#define EOL 35

#define MM 0
#define INCH 1

#define ISDIGIT(ch) ( (ch < 48) ? 0 : ( ( ch > 57 ) ? 0 : 1 ) )
#define TODIGIT(ch) (ch - 48)

/**
 * @brief extract arguement from each line of canonical code
 *
 * @param code_line contains one line of canonical code
 * @param floatArg[9] array of arguments in current canonical function line
 * @param num number of arguments in current line of canonical function
 */
void extractArgs(char *code_line,FLOAT_I floatArg[9],int num);

/**
 * @brief receives a single line canonical code from vdrive module and passes it to parseLine module for parsing
 *
 * @param code_line single line of canonical code for passing to parseLine
 */
void reader(char *code_line);

/**
 * @brief parse canonical functions
 *
 * @param code_line[codeMax] canonical code lines
 */
void parseLine(char code_line[codeMax]);

#endif
